<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
						
%>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
    
        <meta name="format-detection" content="telephone=no" />
    <title>男装专区</title>
    <link rel="stylesheet" type="text/css" href="<%=path %>/statics/css/loaders.min.css"/>
    <link rel="stylesheet" type="text/css" href="<%=path %>/statics/css/loading.css"/>
    <link rel="stylesheet" type="text/css" href="<%=path %>/statics/css/base.css"/>
    <link rel="stylesheet" type="text/css" href="<%=path %>/statics/css/style.css"/>
      <script src="<%=path %>/statics/js/jquery.min.js" type="text/javascript" charset="utf-8"></script>
      <script type="text/javascript" src="<%=path%>/statics/resource/js/jquery.js"></script>



    <!--弹窗  -->
<script  src="<%=path%>/statics/js/jquery-1.8.3.js" type="text/javascript"></script>
<script type="text/javascript" src="<%=path %>/statics/js/alertPopShow.js"></script>     
     <link rel="stylesheet" href="<%=path %>/statics/css/sysz.css">
     
    <script type="text/javascript">
   	
    	$(window).load(function(){
    		$(".loading").addClass("loader-chanage")
    		$(".loading").fadeOut(300)   		   		
    	})
    </script>
</head>
<!--loading页开始-->
<div class="loading">

	<div class="loader">
        <div class="loader-inner pacman">
          <div></div>
          <div></div>
          <div></div>
          <div></div>
          <div></div>
        </div>
	</div>
</div>
<!--loading页结束-->
<body>

	<header class="top-header fixed-header">
			<a class="icona" href="javascript:history.go(-1)">
					<img src="<%=path %>/statics/images/left.png"/>
			</a>
			<h3>去结算</h3>
			<a class="iconb" href="shopcar.html">
			</a>
	</header>
	
	<div class="contaniner fixed-cont">
		<section class="to-buy">
			<header>
			
			<div class="now">
					<span><img src="<%=path %>/statics/images/map-icon.png"/></span>
					<input hidden="hidden" type="text" value="${user_address.iPhone }" id="iphones"/>
						<dl>
							<dt>
								<b>${user_address.remark } </b>
								<strong>${user_address.iPhone }</strong>
							</dt>
							<dd><c:if test="${user_address!=null }">${user_address.address}</c:if> <c:if test="${user_address==null }"><strong onclick="location.href='<%=path %>/user/sys/buyaddress.html?number=${number
 }&color=${color }&size=${size }&proid=${product.id }' " style="color: red;">请选择收货地址</strong>   </c:if></dd>
							<p onclick="address(${user.id})"><c:if test="${user_address!=null }">其他地址</c:if></p >
						</dl>
				</div>
			
				<c:if test="${user_address!=null }">
				
				<div class="to-now">
					<div class="tonow">
							<label class="ton" for="tonow"   onselectstart="return false" ></label>
							
							<input type="checkbox" id="tonow"/>
					</div>
					<dl>
							<dt>
								<b>${user_address.remark }</b>
								<strong>${user_address.iPhone }</strong>
							</dt>
							<dd>${user_address.address }</dd>
					</dl>
					<h3><a href="<%=path %>/user/sys/do-address.html"><img src="<%=path %>/statics/images/write.png"/></a></h3>
				</div>
				</c:if>
			</header>
				<c:if test="${listtro==null }">
			<div class="buy-list">
				<ul>
				
			
					<a >
						<figure>
							<img src="<%=path %>/statics/files/${product.fileName}"/>
						</figure>
						<li>
							<h3>${product.description }</h3>
							<span>
								<c:if test="${product.categoryLevel1Id > 1 }">
									颜色：${color }
								</c:if>									
								<br />
								<c:if test="${product.categoryLevel3Id > 1 }">
									尺寸：${size }
								</c:if>								
							</span>
							<b>￥${product.price }</b>
							<small>×${number}</small>
						</li>
					</a>
						
				</ul>
				<dl>
					<dd>
						<span>运费</span>
						<small>包邮</small>
					</dd>
					<dd>
						<span>商品总额</span>
						<small>￥${sum }</small>
					</dd>
					<dt>
						<textarea rows="4" placeholder="给卖家留言（50字以内）"></textarea>
					</dt>
				</dl>
			</div>
			</c:if>
			<c:if test="${listtro!=null }">
				
				<c:forEach items="${listtro}" var="tro">
			<div class="buy-list">
				<ul>
			
				
			
				<a >
						<figure>
							<img src="<%=path %>/statics/files/${tro.products.fileName}"/>
						</figure>
						<li>
							<h3>${tro.products.description }</h3>
							<span>
								<c:if test="${tro.products.categoryLevel1Id > 1 }">
									颜色：${tro.color }
								</c:if>									
								<br />
								<c:if test="${tro.products.categoryLevel3Id > 1 }">
									尺寸：${tro.size }
								</c:if>								
							</span>
							<b>￥${tro.products.price }</b>
							<small>×${tro.num}</small>
						</li>
					</a>
				
				
				</ul>
				<dl>
					<dd>
						<span>运费</span>
						<small>包邮</small>
					</dd>
					<dd>
						<span>商品总额</span>
						<small>￥${tro.count }</small>
					</dd>
					
				</dl>
			</div>
				</c:forEach>
				</c:if>
		</section>
		<!--底部不够-->
		<div style="margin-bottom: 9%;"></div>
	</div>
	
	<footer class="buy-footer fixed-footer">
			<p> 
				<small>总金额</small>
				<b>￥${sum }</b>
			</p>
				
				<input type="button" onclick="funsa()" value="去付款"/>
	</footer>
	<script type="text/javascript">
function funsa(){
	var iphones = document.getElementById("iphones").value;
	
	 if(iphones==""){
	  webToast("请填写收货地址","middle",1000);
	  return;
	 }
	}
	</script>
	<script type="text/javascript">
		$(".to-now .tonow label").on('touchstart',function(){
			if($(this).hasClass('ton')){
				$(".to-now .tonow label").removeClass("ton")
			}else{
				$(".to-now .tonow label").addClass("ton")
			}
		})
	</script>
	<script type="text/javascript">
	
	function address(id){
   		
	   window.location="<%=path%>/user/sys/addres.html";
    }
	</script>
</body>
</html>